package com.zhou;

import java.util.Scanner;

/**
 * T9
 *
 * @author zhouxianfeng
 * @date 2021-8-20
 */
public class T9 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int num = in.nextInt();
        in.nextLine();
        String[] pi = in.nextLine().split(" ");

        // false 标识基数，true 表示偶数
        boolean[] choose = new boolean[num];
        int total = 0;
        for (int i = 0; i < pi.length; ) {
            total++;
            if (choose[i]) {
                choose[i] = !choose[i];
                i++;
            } else {
                choose[i] = !choose[i];
                i = Integer.parseInt(pi[i]) - 1;
            }

        }
        System.out.println(total);


    }

}
